home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
TP051792.ARJ
/
05-17-92.TPC
Wrap
Text File
|
1992-05-17
|
93KB
|
2,888 lines
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 01-01-00 00:00:00
From
To
Subject
--- WM v2.01/92-0100
* Origin: A.C.E. of Spades (615)383-4381 The B.A.N. board (1:116/33)
* Tossed by SFToss v1.00b on 92/04/09 12:01:00
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-10-92 17:57:07
From Trevor Carlsen
To Peter Beeftink
Subject The function "pos"
PB> The function "pos" finds a substring within a larger string. Is there
PB> a neat way to make the search independent of upper or lower case?
PB> For instance, if my substring is all uppercase, let it find that
PB> substring in the main string if it has mixed case letters there?
The best way would be for you to get a copy of Eagle Software's string package
or Turbo Power's Object Professional package.
The former has a string unit that is about as fast and as complete as is possibl
, is shareware (although the registered version is more complete) and has
exactly what you want.
If you do not wish to do this then your only option is to turn both strings
to the same case before you call the pos function.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/10 19:09:30
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-10-92 08:50:44
From Dj Murdoch
To BRIAN PAPE
Subject Re: TP 6.0 BUG LIST (RELEASE
BP> And that list doesn't even include the annoying bugs in the IDE...
The point of the list isn't Borland-bashing, it's the fact that if you're
using a compiler, you're much better off to have a list of the bugs than not.
I'd list bugs in the IDE, if there were any that affected the way it compiles
programs, but I've never been told of any.
If I wanted to bash Borland, it would be because there was no such list availabl
for TP before 6, and because it's such a lot of trouble for me to maintain
the list, when they should be doing it.
Since I don't have a pre-6 list, I can't say this for sure, but my gut feeling
is that TP 6.01 is a somewhat safer compiler to use than any of TP 4-5.5.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/11 08:11:00
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-10-92 08:59:23
From Dj Murdoch
To Greg Williams
Subject Re: Customising TV...
GW> Has anyone come up with a good way to totally revamp TV menus and dialogs?
GW> I'm trying to work out how far "down" you can go in
GW> modifying the LOOK while still keeping the functionality.
GW> For example, adding shadows to the boxes and making the
GW> border characters used configurable is a high priority at present.
GW> Yurrrkkk - just can't handle that green, chunky feel.... :->
A lot of those thinks are controlled by private fields/methods. For example,
when I was working on a monochrome monitor, I *hated* the TV scroll bars:
they make the mouse cursor disappear. To fix them, I had to modify a private
field (sorry, I forget which one) which contained all the scroll bar characters.
Obviously, the safest way to modify private fields is to get the TV source
and work with it. However, if you want, there's another way: you can patch
a .TPU to make private fields/methods public. Each field in an object declarati
n has a single bit to determine public vs. private. Just go in and flip that
bit, and you'll be able to modify private fields.
Finding the bit isn't easy, but Peavey's TPU6.ZIP or TWU1.ZIP (both of which
I've sent out on PDN) help a lot. My INTRFC62.ZIP (also on PDN) gives a nicer
looking display, IMO, but doesn't give the file offsets or the detail you'd
need for patching.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/11 08:11:00
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-10-92 09:31:29
From Dj Murdoch
To Mike Normand
Subject Re: Over my head....
MN> It is important to state that the names are in a data base
MN> and not DOS based files.... I cant just call up the Dos
MN> services and do pattern matching.
...
MN> I can get the program to work if I dis-allow the ?
MN> character and only allow the * character....but I would
MN> like to have both fully usable.
Here's how I'd do it:
First, translate the *s into ?s. For example, ABC*.* should be changed to
ABC?????.???. It's probably also a good idea to map lower case characters
to upper case ones at this point.
Then, when you want to check whether a particular file matches, first put
it into the same 8.3 form: abcd.pas would become "ABCD .PAS". (The period
could be stripped out in both cases, if you like.)
Now checking whether the file matches the pattern is easy: just loop through
the filename, and abort if the character doesn't match the pattern, and the
pattern isn't a ?:
match := false; for i:=1 to len do
if (pattern[i] <> '?') and (pattern[i] <> filename[i]) then
exit; match := true;
I hope this helps.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/11 08:11:00
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-10-92 09:43:03
From Dj Murdoch
To Bob Bannon
Subject Re: Impact of .TPU size on .EXE size
BB> Suppose someone has numerous TP unit files that each
BB> contains a large number of procedures. Assume also that I
BB> want to write a small program that has the misfortune of
BB> needing JUST ONE procedure from each of the several large
BB> units, thus causing me to have to include ALL the units in
BB> my USES statement.
BB>
BB> My question is this: when the program is compiled to disk
BB> as an .EXE file, does TP compile into my program all the
BB> extraneous procedures that I am not using from all the
BB> different .TPU files, thus causing my .EXE file to be
BB> excessively large, or does TP just take the code for the
BB> procedures that I use (I suspect the former is correct but
BB> I just wanted to check)?
Your suspicion is wrong. The "smart linker" only includes the procedures
(and data) that you reference (directly or indirectly).
There are a few surprises though. These are all documented, but you might
not have noticed them:
1. Just using a unit counts as a reference to its initialization section.
The initialization section probably makes references to data and code in
the unit, so you'll get that whether you expect it or not.
2. Data isn't pulled in variable-by-variable, it's pulled in by declaration
block. For example, if you have global declarations
var
important : byte;
junk : array[1..20000] of byte; and you make a reference to important,
the linker will also put junk in your .EXE. Add an extra "var" before junk,
and this won't happen.
3. Code is generally pulled in procedure by procedure, but not for external
code. If you link external .OBJ files, any reference to the .OBJ code pulls
in the whole .OBJ. This, together with 1, means that the program
uses
crt;
begin
end. ends up much larger than
begin
end. because the former one links in most of the CRT unit code and data.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/11 08:11:01
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-10-92 16:11:46
From Dj Murdoch
To Jud Mccranie
Subject Re: Pascal Style #2
JM> Which is better Pascal style:
JM> x := 1;
JM> if y > 10 then x := 2;
JM> or
JM> if y > 10
JM> then x := 2
JM> else x := 1;
JM> I'm more concerned with the programmer-level reasons, rather than
JM> execution speed or code size.
I use both, depending on the particular situation. If the "y > 10" condition
is a weird exception, I'll always code it the first way, to emphasize that
x := 1 is "normal", and x := 2 is "special". But if "y > 10" is just as likely
as "y <= 10", I'll use the second one, to emphasize the symmetry. When things
aren't quite balanced, but are relatively close, I like to put the most likely
branch first.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/11 08:11:01
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-11-92 18:07:08
From Trevor Carlsen
To Mike Normand
Subject Over my head....
MN> I am trying to get a routine that will allow a person to enter the
MN> name of a file that is stored in a typed record and then pull out all
MN> the files that match the users input.
MN>
MN> I can get it to work fine if they dont use any wildcards, but I want
MN> to fully impliment the ? and * into the program.
MN>
MN> It is important to state that the names are in a data base and not DOS
MN> based files.... I cant just call up the Dos services and do pattern
MN> matching.
MN>
MN> I want to be able to enter a Filename such as ABC??.* and have the
MN> program pull all the matches out of the database...and thats where I
MN> am stuck
Try this (untested) code -
It will require that you first split both the FileName and the mask into name
and extension and convert to uppercase. The example uses Eagle's StrUpr procedu
e to convert to uppercase.
type
str8 = string[8];
procedure ParseFileName(st: string; var name,ext: str8);
var x : byte;
begin
StrUpr(st);
x := pos('.',st);
if (x <> 0) and (x <> length(st)) then
name := copy(st,1,x-1)
else begin
name := st;
ext := '';
exit;
end;
ext := copy(st,x+1,3);
end; { ParseFileName }
function Matches(name: str8; mask: str8): boolean;
var
x : byte;
GoodSoFar : boolean;
begin
GoodSoFar := true;
for x := 1 to length(mask) do
if (mask[x] = '*') and GoodSoFar then
if mask[x] <> '?' then
if mask[x] <> name[x] then
GoodSoFar := false;
Matches := GoodSoFar;
end; { NameMatches }
As I said - untested but I think it should work.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/12 08:10:13
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-11-92 18:13:41
From Trevor Carlsen
To Bill Long Nu-wave Softwar
Subject SHAREWARE DEALER
BL> I RUN A BUSINESS CALLED NU-WAVE SOFTWARE LOACTED AT 1820 TALCO TERRACE
BL> DELTONA FL. 32738 THE PHONE NUMBERS ARE 904-xxx-xxxx OR 1-800-xxx-xxxx
BL> THE 800 NUMBER CAN BE USED FROM ANYWHERE I HAVE 230 PROGRAMS AVAILABLE
This echo permits limited "on-topic" low key advertising which would be of
interest to echo readers world-wide. This message does not qualify on these
grounds. Please do not post such a message again.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/12 08:10:13
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-11-92 19:49:19
From Trevor Carlsen
To Basil Groman
Subject Features Lacking In Tp
BG> If (TCLint) AND (TPascal) Then
BG> If AvailableToPublic Then
BG> AskWhenHow
BG> Else
BG> Ask_NeedBetaTesters
if (TCLint = Experimental) and (Results = NotYetUptoScratch) then
TCLint := Private
else
TCWillAnnounce;
{ "UptoScratch" means of commercial or near commercial quality }
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/12 08:10:13
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-11-92 08:25:26
From Dj Murdoch
To Richard Morris
Subject Re: Turbovision - Off Topic?
> Not a flat one, but I have code to read the PC Write
> dictionary of a few versions ago.
RM> Mmmm, could be Interesting. Is it your own?
I wrote the reader code, but released it to the public domain. It was written
in TP 3.01 to read the PCWrite 2.7 dictionary; I think it still works on current
versions, but I could be wrong.
The disadvantage of using this is that I believe the dictionary belongs to
QuickSoft, so you won't be able to distribute it without licensing it, but
it's pretty widely available to your users.
Here's the code. I wrote it 5 years ago, and my style has improved since
(I hope!), but I think it works. The basic idea is this: the PCWrite dictiona
y is organized into blocks of 512 bytes. There's an index giving the three
letters starting each block; within each block, words are stored as incremental
differences, with common characters stored in half a byte.
Good luck with it!
type
dict_rec = array[0..511] of byte;
table_rec =
record
jump : byte;
letters : string[3];
end;
var
count,bufpos:integer; {mark current place in dict_buf}
b:byte; {current byte from dict}
word:anystring;
len:integer;
dict_buf: dict_rec;
dict:file of dict_rec;
dict_size:integer;
table : array[0..255] of table_rec;
function whichrec(testword:anystring):integer;
{ Finds which dictionary record to look in for testword }
var
i:integer;
begin
i := dict_size - 1;
while (table[i].letters >= copy(testword,1,length(table[i].letters)))
and (i > 0) do
i := i-1;
whichrec := i;
end;
procedure gotorec(recno:integer);
{ Reads dictionary record into buffer, and sets up bufpos & count }
begin
seek(dict,recno);
read(dict,dict_buf);
with table[recno] do
begin
word := letters;
bufpos := jump shr 3;
if jump and 7 <> 0 then
begin
count := 1;
b := dict_buf[bufpos];
bufpos := bufpos+1;
end
else
count := 0;
end;
end; { procedure gotorec(recno:integer) }
procedure init_dict;
{ Opens dictionary file, and sets up jump table in memory }
var
i,j:integer;
temp:array[1..4] of char;
ok:boolean;
const
dictname:anystring = 'WORDS.MAS';
begin
repeat
assign(dict,dictname);
{$i-} reset(dict) {$i+};
ok := (IOResult = 0);
if not ok then
begin
writeln('Dictionary not found. Enter path to PC Write dictionary:');
if eof(input) then
halt;
readln(dictname);
clrscr;
end;
until ok;
read(dict,dict_buf);
dict_size := dict_buf[6] + dict_buf[7] shl 8;
seek(dict,dict_size);
read(dict,dict_buf);
temp[4] := #0; { to stop Asciiz2s below }
i := 0;
j := 0;
while dict_buf[j] <> $ff do
with table[i] do
begin
jump := dict_buf[j];
move(dict_buf[j+1],temp,3);
letters := asciiz2s(temp);
i := i+1;
j := j+4;
if j > 511 then
begin
read(dict,dict_buf);
j := 0;
end;
end;
end;
function getword:boolean;
{ function to build next word from dictionary, return true if successful }
function getnibble:byte;
{ function to return next nibble from dictionary file }
begin
if count = 0 then
begin
if bufpos > 511 then
begin
read(dict,dict_buf);
bufpos := 0;
end;
b := dict_buf[bufpos];
bufpos := bufpos+1;
count := 2;
end;
if count = 2 then
getnibble := b shr 4
else
getnibble := b and $0F;
count := count -1;
end;
type
lettertable = array[0..$f] of char;
var
nibble:byte;
letter:char;
done :boolean;
const {0 1 2 3 4 5 6 7}
table1:lettertable = ('a','c','d','e','g','i','l','m',
'n','o','r','s','t','u',#1,#2);
table2:lettertable = ('`','b','f','h','j','k','p','q',
'v','w','x','z','y',#3,'''',#4);
{8 9 A B C D E F}
begin
nibble:=getnibble;
if nibble = $0f then
getword := false
else
begin
delete(word,nibble+1,128); { truncate word }
done := false;
repeat
letter := table1[getnibble];
if letter = #2 then
letter := table2[getnibble];
case letter of
#1: begin
getword := true;
done := true;
end;
#3: begin
getword := false;
done := true;
end;
#4: word := word + char(getnibble shl 4 + getnibble)
else
word := word + letter;
end; { case letter }
until done;
end;
end;
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/12 14:37:03
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-11-92 18:23:37
From Dj Murdoch
To Andrew Evers
Subject Re: Loading code at run-time
AE> I have a program that I am working on which will produce
AE> skeleton source code for playing PianoMan files and
AE> Displaying TheDraw files. I would like to release it now
AE> BUT there are other features I can add to it. I was
AE> wondering if there was a way of linking code in at
AE> run-time. NOT overlays but source files compiled later or
AE> by other people which could integrate themselves into the
AE> program.
There are several ways, but they're all messy. The best solution is to use
a DLL under Windows or OS/2. One way under DOS is to compile the new code
into an .EXE, shrink your TP heap, then load the new .EXE into high memory.
Finding entry points is messy, and there will always be problems in a high
level language if you have two run-time libraries loaded.
You might want to take a look at my TPFORT18.ZIP package that does run-time
linking of MS Fortran into TP. It's pretty ugly, but does seem to work.
(You can get it from any PDN Pascal node, e.g. my bossnode, 1:221/177. It's
also available on the Internet from garbo.uwasa.fi in /pc/turbopas/tpfort18.zip.
AE> I was also wondering if anyone has a .TPU -> .OBJ converter.
A .TPU is more like a .LIB than an .OBJ, but I don't know of a .TPU to .LIB
convertor. Borland half-heartedly produced a .TPU to .OBJ convertor for TP
4.0 so that you could use TP with Turbo Prolog, but has since dropped Prolog
and never updated the convertor.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/12 14:37:03
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 06:58:52
From Trevor Carlsen
To Richard Morris
Subject TSR Clock
RM> TC> IDStr : string[14] = $CF'TeeCee''s Clock';
RM> ^^^ IRET
RM> TC> SetIntVec($66,@IDStr); { IDStr is obviously not an interrupt!
RM> }
RM>
RM> It is NOW! So if someone else uses int$66 (Didn't Turbo Powers mod's
RM> to TPC to int on pointer dereference use $66) they won't try to run
RM> your nickname <grin>. I know you left in the gotcha's to point Damian
RM> towards a profesional toolbox, which he SHOULD use, but dangling an
RM> interrupt like that really makes me feel uncomfortable <Brrrrr>.
I agree. However the practice is not unique. The video structure tables
are pointed to in the same way. I must have a look at them and see if the
IRet is used there. It is something I should have done. ( I just looked
- "Interrupts" $1d, $1e and $1f, are not interrupts and do not point to a
structure that has IRet as the first byte. Still that is a little different
I guess - <sigh>.
BTW Adding the IRet *exactly* as you indicate, would not work. The first
byte being executed would still be the length byte. So
const
IRet : word = $cf;
IDStr : string[13]='TeeCee''s Clock';
var
p : pointer;
begin
GetIntVec($66,p); { Int 66h is reserved for user defined interrupts }
inc(longint(p),2);
if string(p^) = IDStr then begin
..
SetIntVec($66,@IRet); ...
Another thing I discovered while double checking this (I wanted to be certain
that the inc was incrementing the offset and not the segment :-)) was that
the compiler regards pointers as an integer type. Thus -
inc(p,2);
will be accepted (and will work) and so will a
byte(p)
typecast.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/12 20:41:35
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 10:08:37
From Trevor Carlsen
To Mike Normand
Subject Over my head....
TC> function Matches(name: str8; mask: str8): boolean;
TC> var
TC> x : byte;
TC> GoodSoFar : boolean;
TC> begin
TC> GoodSoFar := true;
TC> for x := 1 to length(mask) do
TC> if (mask[x] = '*') and GoodSoFar then
TC> if mask[x] <> '?' then
TC> if mask[x] <> name[x] then
TC> GoodSoFar := false;
TC> Matches := GoodSoFar;
TC> end; { NameMatches }
TC> As I said - untested but I think it should work.
Gee... I'm glad I added that last line!! Two changes would be needed to make
this work properly, although it still would not be identical to the way DOS
does things. Here is the amended function -
function Matches(name: str8; mask: str8): boolean;
var
x : byte;
GoodSoFar : boolean;
begin
GoodSoFar := true;
if (length(mask) = 0) and (length(name) <> 0) then
GoodSoFar := false
else
for x := 1 to length(mask) do
if (mask[x] <> '*') and GoodSoFar then
if mask[x] <> '?' then
if mask[x] <> name[x] then
GoodSoFar := false;
Matches := GoodSoFar;
end; { Matches }
DOS does some strange things with wildcards -
'*' is the same as '*.*'
'?' is the same as '?.*'
'?.' is the same as '?.*'
't*' will not find any file that has an extension
't?' is the same as 't*'
't?.' is the same as 't?.*'
(The above was tested using 4DOS running with DRDOS 6 so it may not be the
same as MSDOS)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/12 20:41:35
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 08:04:17
From Dj Murdoch
To Rene Seguin
Subject Re: String Compression
(RS isn't necessarily Rene Seguin!)
RS>Does anybody know where I can get a fast (preferably assembly language)
RS>routine to compress text (ASCII < 127) strings &
RS> decompress them, so that I
RS>can compress/decompress text arrays? The PBCLONE
RS> library in QBasic has one
RS>that uses the "2-gram" compression method - is there a similar method
RS>available in PASCAL (I use QuickPascal which is compatible with TP 5.0)
RS> There is a good implementation of LZW in the DJ Murdoch stream unit.
RS> But the problem is that it uses TP6.0 OOP features... Maybe you could
RS> "hack" on the little fast asm module to make it work on your system.
RS> Look for stream11.zip.
The LZW code in the streams unit is a modified version of Wilbert van Leijen's
TPLZW unit. I think it should work in TP 4 and up. The one problem with
LZW encoding is that it tends to increase the size of small blocks. If you
need to compile each string separately, it wouldn't be a good choice.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/13 10:18:49
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 08:11:49
From Dj Murdoch
To Ryan Mullins
Subject Re: Does anyone?
RM> Does anyone have the list of bugs in TP 6.0? Just curious.
I sent it out on PDN Pascal as TP6BUGS6.ZIP, but I've got an idea something
went wrong - I never saw the announcement that it had arrived. If nobody
has it, I'll send it again.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/13 10:18:49
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-10-92 17:27:00
From Terry Hughes
To Tony Limbert
Subject Re: Looking for
TL>Do you guys have a catalog on disk(Or a Disk File that can be printed up?)
TL>?
Mmm, not really. Our BBS has a collection of text files
describing our products but it's not something we've ever
formalized into a catalog on disk. We do have complete
brochures on all of our products that we could mail to you.
The easiest way for you to get those would be to call our
sales line: 800-333-4160.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/05/14 08:55:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 15:31:02
From Terry Hughes
To Herb Brown
Subject ems/xms/disk swap..
HB>Hi!
HB>Terry, I found some code for EMS/XMS/Disk swapping in an
HB>old issue of Doctor Dobbs Journel. What I was wondering,
HB>did you guys write this and is it ok to post it here? The
HB>source came from a cd-rom and states ya'll (southerner)
HB>wrote it. There was a few people looking for this kind of
HB>code here..
If you're talking about the Doctor Dobbs article from 1989
(May I think) then, yes, you can post that code pretty much
wherever you like. I believe we retained a copyright on that
particular code but we state that it may be freely
distributed. If the article says otherwise then believe it
rather than me.
I'm not 100% sure we're talking about the same article,
though, since the one I'm thinking of addressed only
EMS/disk swapping - no XMS at that time. If we've done
another one since then it's news to me.
FWIW, that source code is availble on our BBS (and others
as well, I guess) as EXECSWAP.LZH.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/05/14 08:55:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 08:02:17
From Dj Murdoch
To David G. Edwards
Subject Re: Procedures...
DG> I think that exit procedures should be reserved for
DG> system-type cleanup such as restoring interrupt vectors.
DG> Closing files and other such "standard" stuff should be
DG> done with regular proc's. IMO, an exit proc should be as
DG> short and "clean" as possible.
I don't understand this - why should exit procedures be special? Do you think
the same thing about unit initialization sections?
I try to keep unit initialization sections small in a multi-purpose unit,
because they make the linker pull in everything that they touch. If you only
want a small part of the unit, you may get the rest too, if you have a unit
initialization. (CRT is an extreme example of this.)
But exit procedures - there's no reason I can see that they shouldn't be as
complicated as necessary to clean up after a unit. I try to keep a single
"owner" in mind for any resource used by a program, and make it the responsibili
y of the owner to clean up the resource - close it if it's a file, dispose
of it if it's allocated on the heap, restore the old value if it's an interrupt
vector. Resources used in the implementation section of a unit often belong
to the unit, so the Exitproc cleans them up.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/14 11:26:43
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 08:10:26
From Dj Murdoch
To Sean Ocker
Subject 256 Colours from DOS (was: compression..
SO> How do I get in 256 color(colour:humour) mode from a DOS prompt before
SO> entering any software. I need to do this to view a certain graphics
SO> file I have.
I've got no idea - shouldn't the viewer program set the graphics mode? Most
256 colour modes aren't standard (only 320x200 is on a standard VGA, I think)
so DOS doesn't really know about them. You could run a little TP program
that set the graphics mode and didn't restore the old one when done, but you
might find that your BIOS doesn't support text in the 256 colour mode, and
you'd be out of luck.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/14 11:26:43
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 08:24:24
From Dj Murdoch
To Trevor Carlsen
Subject Re: Over my head....
TC> begin
TC> GoodSoFar := true;
TC> if (length(mask) = 0) and (length(name) <> 0) then
TC> GoodSoFar := false
TC> else
TC> for x := 1 to length(mask) do
TC> if (mask[x] <> '*') and GoodSoFar then
TC> if mask[x] <> '?' then
TC> if mask[x] <> name[x] then
TC> GoodSoFar := false;
TC> Matches := GoodSoFar;
TC> end; { Matches }
Won't this version still have trouble with embedded asterisks? E.g. if mask='*.
as', it looks as though it won't match "test.pas". Or did you do something
to the mask so that's not possible?
TC> DOS does some strange things with wildcards -
Different parts of DOS do different strange things. For example, DIR * lists
everything, but ERASE * only erases the files with no extension.
TC> '?.' is the same as '?.*'
TC> 't*' will not find any file that has an extension
TC> 't?' is the same as 't*'
TC> 't?.' is the same as 't?.*'
These four don't behave that way under DIR in MSDOS 5. DIR treats them as:
'?.' is '? . '
't*' is 't???????.???'
't?' is 't? .???'
't?.'is 't? . '
The rule seems to be that a missing "." is equivalent to adding ".???" on
the end. For ERASE, the rule looks like a missing "." is like adding a blank
extension. I haven't tried Findfirst/Findnext here.
TC> (The above was tested using 4DOS running with DRDOS 6 so
TC> it may not be the same as MSDOS)
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/14 11:26:43
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 08:35:44
From Dj Murdoch
To Craig Leikis
Subject Re: PASCAL STYLE #2
CL> Execution speed and code size is not affected by style of
CL> programming, it's still the same command. This, of course,
CL> is in most cases. The only thing is really may effect is
CL> source code size..
But the example choice was
x := 1;
if y > 10 then
x := 2;
versus
if y > 10 then
x := 2
else
x := 1;
These do have different code sizes. The second one is 2 bytes longer (21
bytes versus 19 bytes). They take about the same time to execute: the first
one sometimes wastes an assignment, but the second one always executes a jump.
The differences are trivial in this example, but might make a difference in
a big program, or in a critical loop. Still, I generally prefer the second
(inefficient) choice for readability.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/14 11:26:43
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 22:39:57
From Mark Ouellet
To Eric Schreiber
Subject Re: TP 6.0
On 06 May 92, you, Eric Schreiber, of 1:115/858.0 wrote...
MO>> Does it have a TVision section?? If so how long and
MO>> how good ??
ES> I have 2 pascal 6.0 books that I recommend highly:
ES>
ES> The first is Turbo Pascal 6.0 Techniques and Utilities, published by
ES> Ziff-Davis
Thanks Eric, I allready got that one after all the
talk about it.
ES> The second book is Clean Coding in Turbo Pascal 6, published by M&T
ES> books, and
ES> written by Amrik Dhillon, who, I gather, works for Borlands' tech
ES> support
ES> group... This book is 2/3 TV related, has very specific, simple, and
ES> well-
ES> documented examples, and includes a disk w/ all source. THe last 1/3 of
ES> the
ES> book relates to TP fr Windows programming, but is worth the purchase
ES> price
ES> ($37, egads!) even if you don't plan on using TPW...
ES>
ES> I hope this is of some assistance...
Sure is Eric,
2/3 of a book on TV is, to say the least, very
interresting.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/14 11:26:49
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 22:50:02
From Mark Ouellet
To Andrew Krywaniuk
Subject Re: TP6 Variable errors
On 06 May 92, you, Andrew Krywaniuk, of 1:153/949.0 wrote...
AK> I'm pretty new to Turbo pascal, so I'm sure that everyone else out there
AK> knows how to do this:
AK>
AK> When I set a variable as an integer, and the person using my program is
AK> kind of stupid -(I ask: 'How many years old are you?', and they type:
AK> 'sixteen')- how can I avoid the inevitable break in the program, and
AK> replace it with my own 'please enter that on the numeric keypad,
AK> lesserlife' type message? It must be possible because those commercial
AK> programs written in pascal don't abort just because someone can't answer
AK> a simple question.
Andrew,
The answer of course is to get input into a STRING
variable and convert it to numeric via the VAL() procedure.
That is how I did it in the old days (TP 3.x) and it is the
best way to avoid your program crashing because they entered
16.5 instead of an integer.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/14 11:26:49
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 23:04:51
From Mark Ouellet
To Derek Mahar
Subject Re: GetPixel
On 08 May 92, you, Derek Mahar, of 1:167/110.0 wrote...
DM> In a message on <May 05 23:51>, Gerald Gutierrez (1:153/715.5Derekidonet)
DM> writes:
DM>
GG>> Could not find the original question, but assuming that someone
GG>> is looking for the getpixel function in mode 13h:
GG>> Function Z_GetPixel ( X,Y : Word ): Byte;
GG>> Assembler;
GG>> asm
GG>> mov ax,0a000h
GG>> mov es,ax
GG>> mov di,x
GG>> mov ax,y
GG>> xchg ah,al { multiply Y by 320 }
GG>> add di,ax
GG>> shr ax,1
GG>> shr ax,1
GG>> add di,ax
GG>> lodsb
GG>> end;
DM> Why does an xchg ah,al multiply y by 320? This is the same as rol ax,8
DM> which multiplies ax by 256. Could you comment on each line of this code
DM> for me?
Derek,
Exchanging al with ah multiplies AX * 256 which is
put into DI, the (AX*256) is shifted right twice which makes
it (AX*64) and (Ax*64) + (AX*256) = AX * (64+256) = AX *
320.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/14 11:26:49
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 23:17:36
From Mark Ouellet
To Derek Mahar
Subject Re: Multiuser databases
On 07 May 92, you, Derek Mahar, of 1:167/110.0 wrote...
DM> Doesn't Netware provide a means of passing messages directly between
DM> terminals? Are there any inter-node chat applications available? Just
DM> a few ideas I thought I would pass back at you. I would be interested
DM> in knowing the answers to these questions myself.
Derek,
Take a look at.... OOPS MEMORY LAPS.. what's that
darn flying horse's name..Oh yeah, PEGASUS, full E-Mail
system for NetWare with file enclosure etc... and it's
free-ware.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/14 11:26:50
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-12-92 23:25:43
From Mark Ouellet
To Jason Davies
Subject Re: TSR
On 08 May 92, you, Jason Davies, of 1:340/203.0 wrote...
JD> I'm fooling around with TSR's and have met a problem. when it closes a
JD> file I get an run time error #6. Anybody know what I'm doing wrong?
JD> thank you
Jason,
Well since error #6 is "Bad file handle" I suspect
you open the file during initialisation of the TSR and the
error occurs when you try to close it. Normally when a
program terminates ALL it's file handles are closed by DOS
thus the error. File handling in TSR's is a problem for this
reason, when you KEEP the process it is really terminated
and thus all it's open handles are closed. Can't help you
more than this, hope it's enough to get you on the right
track.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/14 11:26:50
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 06:13:30
From Trevor Carlsen
To Kim Heaver
Subject Scrolling a text window
KH> How do you scroll the contents of a text window.
KH> I can see how to create it and write text to it but if I want to
KH> page up and down, how do i do it.
initialise starting line number to lowest value allowed.
Place each screen line into an array.
repeat
Display the number of lines your window holds.
Get and check a keypress
If page up decrement the starting line number by number of screen lines
if possible.
If page down increment the strating line number by number of screen lines
if possible.
until the keypressed indicates exit is requested.
I've netmailed you a copy of a simple file viewer I wrote. If you study that
code it might help a little.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/14 19:43:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 06:45:04
From Trevor Carlsen
To Robert Johnston
Subject Quick Question
RJ> Turbo Pascal Version 6.0 Copyright (c) 1983,90 Borland International
RJ> RACRT.PAS(435)
RJ> RADOOR.PAS(1038)
RJ> NUKEWARS.PAS(1249)
RJ> REG.PAS(57)
RJ> NUKE.PAS(3211): Error 48: Code segment too large.
RJ> end;
RJ> ^
RJ> (NUKE.PAS) to the .OVR file (NUKEWARS.PAS Via {$O NUKEWARS})
RJ> because
RJ> all of them interface in some way with USER_ARRAY (which is the
RJ> array
RJ> that I read all of the user data into at the beginning)...
All that means is that the amount of your global data exceeds the allowable
limit (64K). The fix is simple. Move your biggest structures into the heap.
BTW - You are using hi-bit characters in your signature, please remove as
these are not permitted in FidoNet echos.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/14 19:43:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 19:00:15
From Trevor Carlsen
To Matt Heck
Subject The function "pos"
MH> Function UpString(Mixed : string) : string;
MH> var L : byte;
MH> Temp : string;
MH> begin
MH> Temp:='';
MH> For L:=1 to Length(Mixed) do Temp:=Temp+UpCase(Mixed[L])
MH> end;
Matt, apart from the fact that you have omitted to assign a value to the functio
, there's nothing wrong with this except that it is very, very slow. Using
concatenation in this way is something that should be avoided at all costs.
Here is an alternative that is 577% faster than the above and is very much
more economical in stack usage.
function UpString(Mixed: string): string;
var L : byte;
begin
UpString[0] := Mixed[0];
for L := 1 to length(Mixed) do
UpString[L] := UpCase(Mixed[L]);
end;
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/14 19:43:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 02:18:35
From Trevor Carlsen
To Jud Mccranie
Subject Pascal Style #2
JM> Here is something else on which I'd like to hear people's opinion.
JM> Which is better Pascal style:
JM> x := 1;
JM> if y > 10 then x := 2;
JM> or
JM>if y > 10
JM> then x := 2
JM> else x := 1;
JM> I'm more concerned with the programmer-level reasons, rather than
JM> execution speed or code size.
I would normally choose the second method, although there are occasions when
a third method is preferable.
x := succ(ord(y > 10));
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/14 19:43:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 03:17:27
From Trevor Carlsen
To Joy Mukherjee
Subject Unix Style timestamp
JM> Function GetTimeZone : ShortInt;
JM> {}
JM> Var
JM> Environment : String;
JM> Index : Integer;
JM> Begin
JM> GetTimeZone := 0; {Assume UTC}
JM> Environment := GetEnv('TZ'); {Grab TZ string}
JM> For Index := 1 To Length(Environment) Do
JM> Environment[Index] := Upcase(Environment[Index]);
JM> If Environment = 'EST05' Then GetTimeZone := -05; {USA EASTERN}
JM> If Environment = 'EST05EDT' Then GetTimeZone := -06;
JM> If Environment = 'CST06' Then GetTimeZone := -06; {USA CENTRAL}
JM> If Environment = 'CST06CDT' Then GetTimeZone := -07;
JM> If Environment = 'MST07' Then GetTimeZone := -07; {USA MOUNTAIN}
JM> If Environment = 'MST07MDT' Then GetTimeZone := -08;
JM> If Environment = 'PST08' Then GetTimeZone := -08;
JM> If Environment = 'PST08PDT' Then GetTimeZone := -09;
JM> If Environment = 'YST09' Then GetTimeZone := -09;
JM> If Environment = 'AST10' Then GetTimeZone := -10;
JM> If Environment = 'BST11' Then GetTimeZone := -11;
JM> If Environment = 'CET-1' Then GetTimeZone := 01;
JM> If Environment = 'CET-01' Then GetTimeZone := 01;
JM> If Environment = 'EST-10' Then GetTimeZone := 10;
JM> If Environment = 'WST-8' Then GetTimeZone := 08; {Perth,
JM> Western Austrail
JM> If Environment = 'WST-08' Then GetTimeZone := 08;
JM> End;
I know that this code is not yours Joy, but code such as this makes me shudder!
The least that should be done is to prevent redundant checks by using an "else
if" rather than just "if" for every line after the first "if". That simple
change would significantly speed it up.
Better yet (IMHO) is:
function GetTimeZone: ShortInt;
const
NumberOfZones = 16;
TimeZoneStr : string =
' '+
'EST05 EST05EDTCST06 CST06CDTMST07 MST07MDTPST08 PST08PDT'+
'YST09 AST10 BST11 CET-1 CET-01 EST-10 WST-8 WST-08 ';
TimeZoneVal : array[0..16] of ShortInt =
(0,-5,-6,-6,-7,-7,-8,-8,-9,-9,10,-11,1,1,10,8,8);
var
Environment : string;
begin
Environment := GetEnv('TZ');
StrUpr(Environment); { from Eagle's strg unit }
GetTimeZone := TimeZoneVal [pos(Environment,TimeZoneStr) div 8];
end; { GetTimeZone }
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/14 19:43:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 10:39:56
From Trevor Carlsen
To Greg Belanger
Subject Re: Encryption of sorts.
GB> I'm lookin for a way to Encrypt various aspects of my
GB> programs. For example, I know it's quite easy to use a HEX
GB> editor and go in and edit the program name, autor and
GB> copyright info. Is there a way to make this "text"
GB> unmodifiable? I'm looking for a nice, simple routine..not
GB> 400 lines of encryption code. Any suggestions?
Greg, here is how I do it now. This is not foolproof by any means, but in
order to defeat this it would require many hours of tedious disassembly and
analysis. It requires the use of my unit - endecode - which I will post in
a separate message.
Basically, before compiling your program make up your copyright notice and
set an encryption key and then run this program. The program you wish to
protect must then include the resulting file "copyrite.inc" in a const declarati
n section of your program and you can then do a check for tampering if you
wish. It is for this reason that I like to also include a plain text version
of the copyright notice as this is what an illegal hacker would first go to.
One of the good things about this method is that it does not use typed constants
and it therefore places the coded copyright notice and the key in the code
segment rather than in the data segment, thus complicating the disassembly
and analysis still further.
uses
endecode;
const
hash = '#';
fname = 'COPYRITE.INC';
notice : string =
'Copyright 1991,1992 Trevor J Carlsen - All rights reserved';
keyval = 1234567890; { This can be whatever longint value you choose }
var
f : text;
CodeStr: string;
x : word;
begin
CodeStr := EncryptStr(keyval,notice);
notice := ' notice = '#39+notice+#39#59;
assign(f,fname);
rewrite(f);
writeln(f,'const');
writeln(f,notice); { creates the plain text version constant }
writeln(f,' CodeStr = ');
write(f,' ');
for x := 1 to length(CodeStr) do begin
if x mod 20 = 0 then begin
writeln(f,'+');
write(f,' ');
end;
write(f,'#',ord(CodeStr[x]));
end;
writeln(f,';');
writeln(f,' keyval = ',keyval,#59);
writeln(f);
close(f);
end.
Here is an example of the output of the above code -
const
notice = 'Copyright 1991,1992 Trevor J Carlsen - All rights reserved';
CodeStr =
#155#155#83#152#151#154#148#88#36#77#87#73#119#80#70#143#142#79#101+
#86#130#52#64#79#49#42#156#119#153#41#69#147#58#148#33#67#147#138#137+
#129#43#46#112#38#36#149#37#140#69#117#33#44#60#135#135#65#37#94;
keyval = 1234567890;
And an example of a "protected" program -
uses
endecode;
{$I P:\PROG\COPYRITE.INC }
begin
if DecryptStr(keyval,CodeStr) <> notice then
writeln('Copyright notice has been tampered with...')
else
writeln('Copyright notice integrity is Ok');
end.
Unit endecode in the next message.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/14 19:43:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 10:40:04
From Trevor Carlsen
To Greg Belanger
Subject Re: Encryption of sorts.
Here is the endecode unit.
UNIT Endecode;
{ Simple encryption/decryption routines. }
{ Author: Trevor J Carlsen. Released into the public domain.}
interface
type
starray = array[0..255] of byte;
function Key(var s): longint;
function EncryptStr(key : longint; s: string): string;
function DecryptStr(key : longint; s: string): string;
implementation
function MakeCodeStr(key : longint; s: string): string;
{ Creates a "randomly" constructed string of a similar }
{ length as the string which is to be encrypted. A }
{ longint key is used to permit "password" type }
{ encryption. This key may be passed as a literal or }
{ some password used to calculate it. Using this key, }
{ the last character of the string to be encrypted and }
{ the length of the string, a "code string" is produced. }
{ This code string is then XORd with the original string }
{ to produce the encrypted string. The last character }
{ however must be treated differently so that it can be }
{ easily decoded in order to reproduce the coded string }
{ used for decoding. This is done by XORing it with the }
{ length of the string. To decrypt a string the last }
{ character must be decoded first and then the key coded }
{ string produced in order to decrypt each character. }
var
x : word;
len : byte absolute s;
st : array[0..255] of byte absolute s;
begin
RandSeed := (key * len) DIV st[len];
{This ensures that no two code strings will be similar UNLESS they are
of identical length, have identical last characters and the same
key is used.}
MakeCodeStr[0] := chr(len);
for x := 1 to len do
MakeCodeStr[x] := chr(32 + Random(95));
{Keeping the character between 32 and 127 ensures that the high bit
is never set on the original encrypted character and therefore allows
this to be used as flag to indicate that the coded char was < #32.
This will then permit the encrypted string to be printed without fear
of having embedded control codes play havoc with the printer.}
end;
function Key(var st): longint;
{ Creates a key for seeding the random number generator. st can be a
password }
var
x : byte;
temp : longint;
c : array[1..64] of longint absolute s;
len : byte absolute s;
begin
temp := 0;
for x := 1 to len div 4 do
temp := temp xor c[x];
Key := Abs(temp);
end;
function EncryptStr(key : longint; s: string): string;
var
cnt,x : byte;
len : byte absolute s;
st : array[0..255] of byte absolute s;
CodeStr : starray;
temp : string absolute CodeStr;
begin
temp := MakeCodeStr(key,st);
EncryptStr[0] := chr(len);
EncryptStr[len]:= chr(st[len]);
for x := 1 to len-1 do begin
cnt := st[x] xor CodeStr[x];
inc(cnt,128 * ord(cnt < 32));
EncryptStr[x]:= chr(cnt);
end; { for }
cnt := st[len] xor (len and 127);
inc(cnt,128 * ord(cnt < 32));
EncryptStr[len]:= chr(cnt);
end;
function DecryptStr(key : longint; s: string): string;
var
cnt,x : byte;
st : starray absolute s;
len : byte absolute s;
CodeStr : starray;
temp : string absolute CodeStr;
ch : char;
begin
cnt := st[len] and 127;
st[len] := cnt xor len;
temp := MakeCodeStr(key,st);
DecryptStr[0]:= chr(len);
DecryptStr[len]:= chr(st[len]);
for x := 1 to len-1 do begin
cnt := st[x];
dec(cnt,128 * ord(st[x] > 127));
DecryptStr[x] := chr(cnt xor CodeStr[x]);
end; { for }
end;
end.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/14 19:43:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 11:56:07
From Trevor Carlsen
To Robert Johnston
Subject Quick Question
RJ> NUKE.PAS(3211): Error 48: Code segment too large.
I was just about to delete this message and noticed that my reply to you was
incorrect and want to correct it before I get 50,000 messages pointing out
my error <grin>.
The nuke unit is too big and will require that you break it down into two
or more units. This should be an easy task with a unit of that size. The
way to solve the way that it refers to a big array is just put that array
into a unit of its own and have any unit that refers to that array use that unit.
Sorry about the erroneous "fix" suggestion.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/14 19:43:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 08:08:00
From Dj Murdoch
To BRIAN PAPE
Subject Re: TP 6.0 BUG LIST (RELE
BP> I'm *not* trying to bash Borland... I have so many Borland products (TP
BP> 4.0,5.0,5.5,6.0,TPW), TC++,Paradox 1.0,2.0, Quattro 1.0,2.0,3.0, etc.
BP> etc.) that I obviously like their products... Microsloth on the other
BP> hand...
No problem.
On another topic: do you know why your replies always shorten the subject
line? They also map it to upper case. It really messes up my reader, which
tries to put threads together based on matching the subject; yours never match.
If you could tell me the rule your software uses, I might be able to add
it as an exception.
Oh, just thought of something. Are you manually retyping the subject? If
so, I can't really blame you for shortening it a bit, but I'd recommend finding
a reader that can do it for you automatically.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/15 08:22:58
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 08:18:21
From Dj Murdoch
To Max Maischein
Subject Re: Inlines.INC
MM> Yup, Inlines.INC is my include file for those fast
MM> inline-code, that is inserted directly into the code for
MM> speed reasons. I suspect that it is mainly the same as the
MM> OPInline contents...
Does it just include inline procedures, or others, too? It makes no difference
to an inline procedure whether it's in the same unit or not.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/15 08:22:58
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 08:19:34
From Dj Murdoch
To Max Maischein
Subject Re: Turbovision - Off Topic? / Message r
>> This thing is called the TeX-algorithm, I think.
>> Interested ?
> Mmmm, Yes Max it sounds interesting, is the algorithm in the
> public domain?
MM> Nope. It is out of the famous german computer magazine c't,
MM> number 1992-02, the source code is floating around on many
MM> BBSs in germany ...
But TeX was written by Donald Knuth, and is explicitly public domain. I think
I remember reading about the hyphenation in TeX - it was developed by analyzing
a huge hyphenation dictionary, and looking for patterns.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/15 08:22:58
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 08:21:19
From Dj Murdoch
To Max Maischein
Subject Re: Impact Of .Tpu Size O
MM> be linked in only when needed ... Have a look at DJ
MM> Murdochs TPU1.*, a TPU-Dumper, that will give you detailed
MM> info on TP60 TPU files.
Thanks for the credit, but TPU1 isn't mine. It was written by William Peavy.
I wrote a related program called INTRFC62.ZIP. TPU1 goes for a more low-level
byte-oriented dump, while mine tries for a slightly higher level, showing
the logical relations but not helping you a lot about finding things for patchin
. Either one would show that CRT is mostly one big .OBJ file, but not completel
.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/15 08:22:58
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 08:24:13
From Dj Murdoch
To Joshua Kersey @ 930/22
Subject Re: blah...
JK> I want to copy some .PCX files onto the end of an .EXE
JK> file so that it's all in one file, does anyone have more
JK> knowledge on how to go about this and what I need to know to do this?
Just treat your .EXE as a resource file, and store the .PCX files each as
separate resources. It's fairly painless.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/15 08:22:58
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 08:25:35
From Dj Murdoch
To Stephan Szabo
Subject Re: Compression
SS> Does anyone have any compression routines for TP6?
TPLZW by Wilbert van Leijen is a fast LZW encoder. You can use it directly
if you can find a PDN Pascal node to get it from, or look for my STREAM11.ZIP
which puts an OOP wrapper around it. The next version of STREAMS will probably
also include Huffman encoding.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/15 08:22:58
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-14-92 08:27:34
From Dj Murdoch
To Joe Mezzanini
Subject Re: case/procedures
JM> Can procedure's be called via a case statement
JM> if yes then can you show me an example?
Yes:
Case i of
1 : writeln('i=1');
2 : begin
writeln('i=2');
end;
else writeln('Neither 1 nor 2');
end;
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/15 08:22:58
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 02:11:10
From Trevor Carlsen
To Pat Maher
Subject Scan Codes
PM> Have a LEGAL copy of 6.0, but need some code to read F1, etc function
PM> keys cleanly. I stumbled across the SCANCODE.???? code that is in 6.0,
PM> but it is not documented, as far as I can tell. Anyone have some code
PM> that I could use as a function? Something like CH := SCANKEY; instead
PM> of CH := READKEY; ??
I posted a keyinput unit here in the last few days that will do what you want.
It was 4 messages long so I won't post it again so do a search of the message
base on your board for the words "Keyboard input unit" and you will find it.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/15 20:53:06
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 02:15:07
From Trevor Carlsen
To Brian Stark
Subject Re: UNIX style timestamp
BS> Function IsLeapYear(Source : Word) : Boolean;
BS> {}
BS> Begin
BS> If (Source Mod 4 = 0) Or (( Source Div 10 = 0) And
BS> Source Div 400 = 0) Then
BS> IsLeapYear := True
BS> Else
BS> IsLeapYear := False;
BS> End;
Brian, your original IsLeapYear function was fine for that unit. As you are
obviously aware, Unix timestamps use the number of seconds that have elapsed
since Jan 1970. With the limitations of a longint, no year after that time
can exist that is not a leap year if it is divisible by 4.
Having said that, the above function is incorrect! It should read -
IsLeapYear := ((Source mod 4 = 0) and (Source mod 100 <> 0)) or
(Source mod 400 = 0);
BTW, I am puzzled by your use of time zones in your unit. Is this a required
feature of unix timestamps or something that you have decided to incorporate
for FidoNet?
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/15 20:53:06
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 02:40:22
From Trevor Carlsen
To Dj Murdoch
Subject Re: Over my head....
TC> begin
TC> GoodSoFar := true;
TC> if (length(mask) = 0) and (length(name) <> 0) then
TC> GoodSoFar := false
TC> else
TC> for x := 1 to length(mask) do
TC> if (mask[x] <> '*') and GoodSoFar then
TC> if mask[x] <> '?' then
TC> if mask[x] <> name[x] then
TC> GoodSoFar := false;
TC> Matches := GoodSoFar;
TC> end; { Matches }
DM> Won't this version still have trouble with embedded asterisks? E.g.
DM> if mask='*.pas', it looks as though it won't match "test.pas". Or did
DM> you do something to the mask so that's not possible?
I don't have my message here now but there are two calls to this function,
one for the name and one for the extension. Both the filename and the mask
are split in this way first. I think that answers your query.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/15 20:53:06
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 02:45:26
From Trevor Carlsen
To David G. Edwards
Subject Re: Procedures...
DG> I think that exit procedures should be reserved for system-type
DG> cleanup such as restoring interrupt vectors. Closing files and other
DG> such "standard" stuff should be done with regular proc's. IMO, an
DG> exit proc should be as short and "clean" as possible.
Why? TP gives me the tool so I use it. I have no qualms about many different
exit procedures - even perhaps one per unit if it is justified!
I guess you and I agree on keeping them as concise and clean as possible though
because I regard my whole program in that light! :-)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/15 20:53:07
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 02:53:33
From Trevor Carlsen
To Kevin Higgins
Subject Encryption of sorts..
> I think a better idea is to attack the problem directly: put in
> integrity checking code, and make sure it isn't easy to subvert it.
KH> But how do you do this without substantial delays while checking a
KH> large .exe (or even more likely, a huge .ovr file)?
In all my current work I code on the assumption that the lowest base configurati
n is a '386. I can do that as I don't write any stuff at all that is destined,
or at least intended, for a mass commercial market.
Integrity checking code, even full scale encryption of the complete file can
easily be done in under 2 seconds on exes up to about 250K. At startup I
consider upto 3 or even 4 seconds delay acceptable.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/15 20:53:07
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 17:47:23
From Mark Ouellet
To KEVIN PARADINE
Subject Re: Multiuser databases
On 04 Jan 80, you, KEVIN PARADINE, of 1:107/480.0 wrote...
>> KP> You're better off locking the whole database, rather than a
>> record.
>> KP> Why?
>> Sorry but I disagree, we are using multiple
>>relations on an application at the office and our first rule
>>is if you can't lock records in every file pertaining to the
>>current operation [IE: if deleting a record we lock all
>>related records in every other database before going on]
>>then we simply abort the operation or suspend it until ALL
>>records can be securely worked on.
>> Our next step is networking it and what you
>>described was something we wanted to avoid at all costs.
>>That's why we either secure our environement before doing
>>anything else or don't do anything.
KP> ? You seem to be saying the same thing I am.
KEVIN,
Not exactly, YOU RECOMMENDED LOCKING THE WHOLE
DATABASE rather than LOCKING ON A RECORD BY RECORD BASIS.
THIS IS THE ABOLUTE WORSE PROGRAMMING PRACTICE IN A
NETWORK ENVIRONEMENT.
And it is not what I was saying but you only quoted
what seemed to promote your point and left out the important
part.
NetWorking implies sharing the data, having one
single copy on the server but not sharing it does not
warrant the use of a network since most NetWorks are
installed in offices where the majority of stations allready
have more than enough disk space. So using a NetWork to
reduce the number of copies is not viable if you don't
intend it to be shareable.
You can't just hog the database and keep it from
being used by other stations. Our approach keeps it
available to others as long as they don't try to modify the
same record we are working on, but they can examine the one
we are working on simultaneously and see the changes appear
on their screen as we make them therefor giving them the
most up to date info without loss of time to us or them. And
that is what NetWorking is all about, shareing data.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/15 20:53:14
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 19:20:31
From Mark Ouellet
To Mike Copeland
Subject Re: Pascal Style #2
On 10 May 92, you, Mike Copeland, of 1:114/18.10 wrote...
JM>>Here is something else on which I'd like to hear people's opinion.
JM>>Which is better Pascal style:
JM>>x := 1;
JM>>if y > 10 then x := 2;
JM>>or
JM>>if y > 10
JM>> then x := 2
JM>> else x := 1;
JM>>I'm more concerned with the programmer-level reasons, rather than
JM>>execution speed or code size.
MC> I tend to use the former (establishing a default), to show and assert
MC> that _something_ is assigned to the variable. I also believe that it
MC> tends to avoid certains data-related bugs, since there is always a valid
MC> value...
MC> Also, I feel there is value in showing how the non-default
MC> condition/value is established - since it's an exception. To my
MC> knowledge, there is no performance difference either way.
Mike,
The difference is in debugging of course !!!! Having
single statements/lines allows to break on any
statement.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/15 20:53:14
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 20:05:22
From Mark Ouellet
To Jason Schlachet
Subject Re: Multiuser databases
On 12 May 92, you, Jason Schlachet, of 1:231/70.0 wrote...
JS> If you are writing a muli-user database application, I highly recommend
JS> Clipper, or better yet, Foxpro/Lan. Both offer file sharing and
JS> file/record locking. I have used Foxpro/Lan to help develop a multi-user
JS> application, and ALL users can share the same files at the same time.
JS> Foxpro will run on Novell or Lantastic (the two that I've SEEN it work
JS> on).
Thanks Jason,
I would have jumped on the FoxPro band-wagon years
ago if it hadn't been for regulations. We can't even buy
more Dbase's, we can only upgrade those we have. You know
how governements can be ;-) So we're stuck with Dbase IV but
since Borland is now in the picture things should really get
rolling. They allready got a 1.5 out and one for windoes and
I'm anxiously waiting for the promised compiler. Shouldn't
be too long since they allready produced more in 4 months
than Ashton-tate did in 4 years.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/15 20:53:14
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 20:10:09
From Mark Ouellet
To All
Subject TVision Menu generation
Hi All,
I got dlgdsn and menugen but someone stated they
were almost ready to produce a new one with more features
than these two which I personnaly find limited.
The new version was supposed to support more types
and features.
Does anyone remember this or who was producing the
stuff and does anyone know if it has been released yet ????
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/15 20:53:14
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-13-92 20:14:07
From Mark Ouellet
To Joy Mukherjee
Subject Re: Pascal source
On 10 May 92, you, Joy Mukherjee, of 1:387/255.0 wrote...
SJ>> You have TurboCity at 1:208/2 but you can also poll me for that. Use
SJ>> the magic word PAS to get a list of Pasacal source available here.
JM> I tried it, and it didn't work! What is the correct file name?
Joy,
I beleive the MAGIC NAME OF 'PAS' will only work on
HIS node which is in zone 2. The other turbo city is
probably not related in any way.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/15 20:53:14
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 08:17:00
From Dj Murdoch
To Edward Kmett
Subject Re: TP6 Variable errors
EK> *** Quoting Dj Murdoch to Andrew Krywaniuk dated 05-08-92 ***
EK> > Read the answer as a string - that should always succeed. Then use the
EK> > Val procedure to convert it to an integer, and check the "Code"
EK> > parameter to see if there was a conversion error.
EK> >
EK> Couldn't you just disable IO checking and read it in
EK> until there isn't an error?
I've never tried it that way, but it sounds as though it should work. You'd
want to distinguish non-numeric input from other I/O errors, but that would
just mean you'd have to look at the value of IOResult.
One disadvantage is that you can't give meaningful error messages. It's much
nicer for the user to see a message like:
Cannot read "Fourteen" as a number.
than
Non-numeric input.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/16 14:05:59
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 08:32:56
From Dj Murdoch
To Dan Vanderboom
Subject Re: Parallel Communications
DV> Asking a few questions here and there, I was able to get a
DV> few good books and a firm grasp on serial communications
DV> programming. (Thanks.) I now have a project in front of
DV> me that requires the use of a parallel port (a robotics assembly line).
DV>
DV> Does anyone have a suggestion as to where to look for this
DV> type of information, or am I forced to tediously scan
DV> through all of Ralf Brown's interrupt list? ;)
I know almost nothing about parallel ports, but if I wanted to find out, I'd
look in Robert Jourdain's book, "Programmer's Problem Solver for the IBM PC,
XT, and AT". It's a little old; there might be a newer edition by now.
And rather than looking through Brown's list, get a copy of the book version
of it: Ralf Brown and Jim Kyle, "PC Interrupts", ISBN 0-201-57797-6. It
has a good index.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/16 14:05:59
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 08:44:38
From Dj Murdoch
To Trevor Carlsen
Subject Re: Encryption of sorts.
TC> Here is the endecode unit.
Nice unit! I'd suggest one minor change, though:
TC> function MakeCodeStr(key : longint; s: string): string;
TC> begin
TC> RandSeed := (key * len) DIV st[len];
Just so that you don't have unintended side effects, I'd save the old RandSeed
and restore it at the end of the routine.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/16 14:05:59
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 22:50:56
From Mark Ouellet
To Derek Mahar
Subject Re: GetPixel
On 14 May 92, you, Derek Mahar, of 1:167/110.0 wrote...
DM> In a message on <May 12 23:04>, Mark Ouellet (1:240/1.4) writes:
DM>
MO>> Exchanging al with ah multiplies AX * 256 which is
DM> This is what I don't understand. Suppose AX is 0101h. XCHG AL,AH
DM> results in the same 0101h. If AH is always 0, such as when AX is 0001h,
DM> then I can see how exchanging AL and AH results in a multiplication by
DM> 256. Should I assume AH will always be zero?
Derek,
You are correct and I did make the distinction in a
later message on this same subject. The value to be
multiplied MUST be lower than 256 so as not to encounter
what you described. Anything higher would be more like a
rotate of the register than a shift of it.
Never the less the technique can be applied to
larger numbers but is a bit more tricky. In any case, using
this method on numbers < 256 does save CPU clock cycles
compared to a MUL instruction.
And to answer you last question... NEVER ASSUME
anything the value must ABSOLUTELY be < 256.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/16 14:05:59
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 23:06:23
From Mark Ouellet
To Jud Mccranie
Subject Re: Help - Reading Records At
On 14 May 92, you, Jud Mccranie, of 1:3645/10.0 wrote...
JM> In TP, is there any good way to read records starting at a position in
JM> the file that is not a multiple of the record length?
JM>
JM> I'm converting some files from one format to another, and the record
JM> length is something like 331 bytes, but I need to ignore the first 255
JM> bytes and then start reading records. I know I can first make a copy
JM> the file omitting the trash at the front, but is there a better way to
JM> do it? (Seek works on records, not bytes.)
Jud,
Seek DOES work on bytes if you declare your record to be of 1 byte
length.
To do what you want you'll have to compute the offset yourself. From
the looks of things you seem to want to read some sort of database and want to
skip the header part.
Do it like this:
Suppose header is 255 bytes and each record is 331 bytes long:
TYPE
One_Record = RECORD
331 bytes long structure;
END;
One_Header = RECORD
255 bytes defining header struc.
END;
VAR
My_Record : One_Record;
My_Header : One_Header;
My_File : FILE;
My_File_Name : STRING;
Bytes_To_Read : WORD;
Bytes_Read : WORD;
Record_To_Get : WORD;
Offset_Of_Record : LONGINT;
BEGIN
My_File_Name := 'Clients.dbf';
ASSIGN(My_File, My_File_Name);
RESET(My_File, 1);
{^ important}
SEEK(My_File, 0);
Bytes_To_Read := SIZEOF(One_Header);
BLOCKREAD(My_file, My_Header, Bytes_To_Read, Bytes_Read);
IF (Bytes_Read <> Bytes_To_Read) THEN BEGIN
WRITELN('Could not read in header');
HALT(1);
END ELSE BEGIN
WRITELN('Header read and being processed');
END;
{ To get record 400 (Zero based) }
Record_To_Get := 400;
Bytes_To_Read := SIZEOF(One_Record);
Offset_Of_Record := SIZEOF(One_Header) +
(Record_To_Get * Bytes_To_Read);
SEEK(My_File, Offset_Of_Record);
BLOCKREAD(My_File, My_Record, Bytes_To_Read, Bytes_Read);
END.
As you can see it's only logical, you know the size of the header and you
know the size of each record so you can compute the offset. When you deal with
untyped files with no header, that is all TP is really doing for you.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/16 14:05:59
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 23:28:00
From Mark Ouellet
To Jud Mccranie
Subject Re: Pascal Style #2
On 15 May 92, you, Jud Mccranie, of 1:3645/10.0 wrote...
GT>> This is because I can
GT>> add a statement to the block without thinking about having to
GT>> add a begin/end. The begin/end block don't affect the exicution
GT>> speed but do help readability.
JM> I see that point but I don't believe I add to a 1 statement block very
JM> often.
Jud,
It may be so but, I do it that same way to because
only a 1 statement block will ever need a begin-end pair
added if I do add statements.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/16 14:05:59
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-15-92 07:27:18
From Mark Ouellet
To Derek Mahar
Subject Re: Fast video (was: thanks)
On 13 May 92, you, Derek Mahar, of 1:167/110.0 wrote...
DM> In a message on <May 10 11:30>, Gerald Gutierrez (1:153/715.5Derekidonet)
DM> writes:
DM>
GG>> Multiply 253 by 160:
GG>> mov bx,253
GG>> xchg bh,bl
GG>> shr bx,1
GG>> mov ax,bx
GG>> shr bx,1
GG>> shr bx,1
GG>> add ax,bx
DM> Can you explain to me how this works? Escpecially the role of the line
DM> XCHG BH,BL.
Derek,
It's as allways based on the base 2 multiplication.
Since shifting a register X number of bits left or right
equals multiplying or dividing that register by the
equivalent power of 2 ie: shr AX, 2 would divide AX by 4 or
by (2^2). Now since any number from 1 to 256 can be
decomposed into it's (powers of 2) constituants ie: 160 is
really 128 + 32, 161 is 128 + 32 + 1. This way you create
each component, add them and if by any chance you are
multiplying by an ODD number simply initialise the output
register with the original value.
Example 253 * 160
mov bx,253 {Move value to BX}
xchg bh,bl { this essentially multiplies BX by 256 }
it's the same as shr BX, 8, except this
one works as long as the value to
multiply is lower than 256 since any
bit set in bh would be lost. SHR BX,8
essentially moves the lower 8 bits of
BX into its high part}
shr bx,1 { Up to this point BX = 253 * 256,
shifting this right once divides it by
2 making it 253 * (256/2)=.... you
guessed it, 253 * 128}
mov ax,bx { save that into AX }
shr bx,1 { divide by 2 again = 253 * 64 }
shr bx,1 { again = 253 * 32 }
add ax,bx { Now (253*128) + (253*32) = 253*(128+32)
which equals 253*160 }
As you can see, since any number < 256 is composed of
multiples of 2 added together, any multiplication can be
made this way avoiding the use of MUL which is time
consumming for the CPU.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/16 14:05:59
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-16-92 02:56:05
From Trevor Carlsen
To Jud Mccranie
Subject Help - Reading Records At
JM> In TP, is there any good way to read records starting at a position in
JM> the file that is not a multiple of the record length?
JM> I'm converting some files from one format to another, and the record
JM> length is something like 331 bytes, but I need to ignore the first 255
JM> bytes and then start reading records. I know I can first make a copy
JM> the file omitting the trash at the front, but is there a better way to
JM> do it? (Seek works on records, not bytes.)
uses dos;
const
Offset : word = 331;
var
YourRec : RecordType;
f : file of RecordType; { open in the normal way }
procedure ReadRec(var f; RecNo: longint; var Rec);
var
OldSize : word;
begin
with FileRec(f) do begin
OldSize := RecSize;
{$I-};
seek(file(f),(RecNo * OldSize)+Offset);
CheckIO; { to check IOResult. Put whatever is needed in this }
RecSize := OldSize;
BlockRead(file(f),Rec,1);
CheckIO;
{$I+}
end; { with }
end;
Untested. That is purely to allow the file to be declared as being of the
type in YourRecord. It may be better to just bite the bullet and open it
as an untyped file of record length 1. Then seek to the calculated file offset
and read the number of bytes needed for a record.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/16 18:48:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-16-92 03:17:47
From Trevor Carlsen
To Matt Heck
Subject GIFSlow ?
MH> Trevor, this is somewhat large, but it will help alot of people,
MH> is this okay to post?
MH> If he says okay, than if you post some Sound Blaster code (preferably
MH> that which uses internal routines, not the drivers) I'll toss up
MH> GIFSLOW.
You don't say how big it is. If it is more than, say 4 100 line messages,
I'd prefer to see you ask your sysop to make it available for FREQing, and
then advising GG of that. Another way is to ask your sysop to hatch it into
the PDN.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/16 18:48:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-16-92 03:23:07
From Trevor Carlsen
To Chris Kelling
Subject Re: A Virtuous Pascal ...
CK> And VAX PASCAL blows TP out of the water.
Having used both, I can't say I agree with that, unless recent versions of
the VAX product have improved significantly. Instead of just making such a
statement why don't you post your reasons also?
I feel VAX Pascal has an advantage over TP where standard Pascal syntax is
necessary - particularly in regard to file I/O. TP runs rings around it with
its bit manipulation, general file (non standard) I/O, machine guts level
stuff etc.
However as they run on totally different platforms, that is hardly what I'd
call a fair comparison. VAX Pascal is the best Pascal for the VAX (for all
I know it may be the ONLY Pascal for the VAX), and TP is, IMHO, the best "Pascal
for the MS-DOS based PC environment.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/16 18:48:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-16-92 03:38:16
From Trevor Carlsen
To Steve Gabrilowitz
Subject Re: Over my head....
TC> DOS does some strange things with wildcards -
TC> '*' is the same as '*.*'
TC> '?' is the same as '?.*'
TC> '?.' is the same as '?.*'
TC> 't*' will not find any file that has an extension
TC> 't?' is the same as 't*'
TC> 't?.' is the same as 't?.*'
TC> (The above was tested using 4DOS running with DRDOS 6 ...
SG> I think you're wrong about ?. being treated like ?.*, I just tried it
SG> here and it was treated differently (4DOS with MSDOS 4.01). Now
SG> what's really interesting is that DOS doesn't even seem to be
SG> consistent with itself...
If using the dir command you are right. Other programs can yield different
results. Interesting.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/16 18:48:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-16-92 15:53:39
From Trevor Carlsen
To Jud Mccranie
Subject Help - Reading Records At
JM> In TP, is there any good way to read records starting at a position in
JM> the file that is not a multiple of the record length?
After posting a solution to this problem in the early hours this morning,
I realised that I had written such a function sometime ago and included it
in one of my own toolboxes. As this version is tried and proved and is slightly
different to what I previously entered off the cuff, here 'tis -
{$I-}
function ReadRec(var f; { The typed or untyped file }
RecNo : longint;{ The record number to read ( zero based) }
Offset: word; { The size of the header }
var Rec;{ The record to be read - untyped for convenience }
ErrCode: { I/O error code } integer): boolean;
{ Reads a record number from a file of typed records that has an odd size}
{ header record. Returns true if read was OK. (Requires the DOS unit) }
var
OldSize,
result : word;
begin
with FileRec(f) do begin
OldSize := RecSize; { Save the declared record size }
RecSize := 1; { Change to a single byte record size }
seek(file(f),(RecNo * OldSize) + Offset);{ Seek to calculated offset }
RecSize := OldSize; { Restore the record size }
ErrCode := IOResult; { Check for I/O error }
if ErrCode <> 0 then { an I/O error occurred }
ReadRec := false
else { no I/O error } begin
BlockRead(file(f),Rec,1,result); { Read a single record }
ErrCode := IOResult; { Check for I/O error }
ReadRec := (ErrCode = 0) and (result = 1);
end; { else }
end; { with }
end; { ReadRec }
{$I+}
To use, just open your file as a typed file of the type you need then to read
record number RecordNumber -
if not ReadRec(f,RecordNumber,HeaderSize,YourRecord,ErrorCode) then
writeln('I/O read error ',ErrorCode,' record number ',RecordNumber);
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/16 18:48:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-16-92 11:14:12
From Trevor Carlsen
To BRIAN PAPE
Subject Illegal origin line
BP> --- Mosaic v1.00
BP> * Origin: "Universal Worlds" -= The Worlds Of Astronomy & Science =-
BP> (618) 931-8226
Brian, it is a requirement of both FidoNet and this echo that the origin line
in messages has a valid nodelisted address and does not exceed 79 characters
in length. Please fix.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/16 18:48:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-16-92 16:01:25
From Trevor Carlsen
To Dave Blaser
Subject Overlay files?!
DB> ... first, does anyone out there in BBS land know
DB> how in the heck to make TurboPascal create Overlay files?
DB> Is there a special unit that I have to include?
You do not say which TP version you own. If TP4 then you are out of luck
as there are no overlays in that version. If you own later versions then
the manual contains a complete chapter with a full explanation of what is
required. So maybe you should RTFM!
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/16 18:48:26